<!doctype html>
<html>

<head>
	<meta charset="utf-8">
	<title>无标题文档</title>
	<link href="/static/css/default.css" rel="stylesheet" type="text/css">
	<link href="/static/css/style/green.css" rel="stylesheet" type="text/css" id='link'>
	<link href="/static/js/datepicker/css/bootstrap-datepicker.css" rel="stylesheet">

	<link href="/static/css/bootstrap.min.css" rel="stylesheet" type="text/css">
	<link href="http://vjs.zencdn.net/5.0.2/video-js.css" rel="stylesheet">
    <script src="http://vjs.zencdn.net/ie8/1.1.0/videojs-ie8.min.js"></script>
    <script src="http://vjs.zencdn.net/5.0.2/video.js"></script>

</head>

<body style="padding:15px 8px 0px 8px;">
	<div class="classify">摄像头

			<a style="float:right;margin-right:20px;" onclick="window.history.back()">返回</a>
	</div>
	<ul class="toolbar">
		<li><a href="#" class="selected"  id="add"><i class="toolico iconfont">&#xe649;</i>添加</a></li>
	 
	
	</ul>
	
	<div class="tablebox" id="main">
		<div>
				{volist name="videos" id="vo"}
				<li style="float:left;margin:10px;width:45%">
					 <p>标题：{$vo.title}</p>
					<p>摄像头编号：{$vo.videourl}</p>
					<p>推流地址：{$vo.rtmpurl}</p>
				
					<div id="video{$vo.id}" style="width: 100%; height: 250px;background-color: #000000" data-url="{$vo.url}"></div>
						<p style="text-align:right">
							<a href="#" class="selected"  onclick="play('video{$vo.id}','{$vo.url}')">播放</a>
							<a href="#" class="selected"  onclick="update({$vo.id})">修改</a>
							<a href="#" class="selected"  onclick="del({$vo.id})">删除</a>
						</p>
				</li>
			{/volist}
		</div>
	

	</div>
	<input type="hidden" id="mid" value="{$mid}" />
</body>
<script type="text/javascript" src="/static/js/jquery.js"></script>
<script type="text/javascript" src="/static/js/common.js"></script>

<script src="/static/js/layer/layer.js"></script>

<script type="text/javascript" src="/static/js/vue2.js"></script>
<script type="text/javascript" src="/static/js/vue-nav.js"></script>
<script type="text/javascript" src="/static/ckplayer/ckplayer.js"></script>
<script>

$('#add').on('click', function(){
				var mid =$("#mid").val();
			  parent.layer.open({
			  title:'信息添加',
			  type: 2,
			  area: ['600px', '550px'],
			  fixed: false, //不固定
			  maxmin: true,
			  content: '/super/mechanism/videoadd2?mid='+mid
			}); 
		});
		function play(id,url){
			var videoObject = {
				container: '#'+id, //容器的ID或className
				variable: 'player',//播放函数名称
				flashplayer:true,
				poster:'material/poster.jpg',//封面图片
				video: [//视频地址列表形式
					[url, 'video/flv', '中文标清', 0],
					
				]
			};
			var player = new ckplayer(videoObject);
		}
		function update(id){
				parent.layer.open({
					title:'信息修改',
					type: 2,
					area: ['600px', '550px'],
					fixed: false, //不固定
					maxmin: true,
					content: '/super/mechanism/videoadd2?id='+id
				}); 

		}
		function del(id){
			parent.layer.confirm('确定要删除吗?', {
					btn: ['是', '否'] //按钮
				}, function () {
					$.post("/index/daily/videodel", { "id": id }, function (data) {
						if (data.status == 200) {
							parent.layer.msg(data.message);
							window.location.reload();
						} else {
							parent.layer.msg(data.message);
						}
					});
				}, function () {

				});

		}
</script>

</html>